<cfcomponent output="false">
	
	<!--- --->
	
	<cffunction name="saveActivity" access="public" output="false" returntype="string">
		<cfargument name="amount" required="true" />
		<cfargument name="paymentID" required="true" />
		<cfargument name="sourceID" required="true" hint="the fundID" />

		<cfset var local = {} />

		<cfif session.user.id eq ""><cfthrow message="not logged in" /></cfif>
		
		<cfif arguments.amount eq "" or not isNumeric(arguments.amount) or arguments.amount eq 0>
			<cfthrow message="invalid amount [#arguments.amount#]" />
		</cfif>
		
		<cfif arguments.paymentID eq "" or len(arguments.paymentID) neq 17>
			<cfthrow message="invalid paymentID [#arguments.paymentID#]" />
		</cfif>
		
		<cfset local.activityID = $.database.save(
			table="payment_activity",
			amount=arguments.amount,
			payment_id=arguments.paymentID,
			source_id=arguments.sourceID
		) />
		
		<cfreturn local.activityID />

	</cffunction>
	
	<!--- --->

</cfcomponent>